﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FoursquareNET.Venue
{
    public class GetCategoryList
    {
        private const string URL = "http://api.foursquare.com/v1/categories";
        private const Common.HttpRequestMethod HTTP_REQUEST_METHOD = Common.HttpRequestMethod.GET;
        
        private List<Parameter> Parameters = new List<Parameter>();

        public GetCategoryList()
        {
            
        }

        public List<Schema.Category> Execute()
        {
            return Execute(new Credential());
        }

        public List<Schema.Category> Execute(Credential credential)
        {
            StringBuilder url = new StringBuilder(URL);

            string result = Common.HTTPPost(URL, Parameters, credential, HTTP_REQUEST_METHOD);

            return new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<Schema.CategoriesObj>(result).Categories;
        }

        #region Parameters

        //no parameters

        #endregion
    }
}
